﻿using IntelligentAgriculture.Contracts.Interface;
using IntelligentAgriculture.Services;
using IntelligentAgriculture.WebAPI.Application.Command.BodyMeasureModelCommand;
using IntelligentAgriculture.WebAPI.Application.Command.SheepCommand;
using IntelligentAgriculture.WebAPI.Application.CommandHandler.SheepCommandHandler;
using MediatR;

namespace IntelligentAgriculture.WebAPI.Application.CommandHandler.BodyMeasureModelCommandHandler
{
    public class BodyMeasureModelDeleteCommandHandler : IRequestHandler<BodyMeasureModelDeleteCommand, Results<int>>
    {

        private readonly IBodyMeasureModelService bodymeasureService;
        private readonly ILogger<BodyMeasureModelDeleteCommandHandler> logger;
        public BodyMeasureModelDeleteCommandHandler(IBodyMeasureModelService bodymeasureService, ILogger<BodyMeasureModelDeleteCommandHandler> logger)
        {
            this.bodymeasureService = bodymeasureService;
            this.logger = logger;
        }

        public async Task<Results<int>> Handle(BodyMeasureModelDeleteCommand request, CancellationToken cancellationToken)
        {
            var list = await bodymeasureService.Delete(request.Ids);
            return Results<int>.DataResult(list);
        }



    }





}
